Skip to content

idma: Streamline TCDM connection, enable multi-channel operation - #330

Open
gbellocchi wants to merge 64 commits into
pulp-platform:mainfrom
gbellocchi:gb/idma_tcdm_multich_develop
Open

idma: Streamline TCDM connection, enable multi-channel operation#330
gbellocchi wants to merge 64 commits into
pulp-platform:mainfrom
gbellocchi:gb/idma_tcdm_multich_develop

Conversation

@gbellocchi

@gbellocchi gbellocchi commented Aug 4, 2026

Copy link
Copy Markdown

Description

This PR updates the iDMA integration within the Snitch cluster, as shown in Figures 1 and 2.
It is a refreshed version of PR #238 , which had fallen behind the main snitch cluster branch due to being open for a long period, and a continuation of PR #322.

New features include:

  • The wide SoC port directly connects to the TCDM subsystem, allowing external data access while DMA transfers run.
  • The wide DMA XBAR has been simplified.
  • The DMA uses the OBI protocol to connect to the TCDM subsystem.
  • Arbitration between the channels, the superbanks, and the SoC port happens now in TCDM, increasing flexibility and throughput. With minimal changes, it is possible to have multiple DMA cores in the cluster.
  • Add DMINIT support in Snitch cluster.
  • Add support for OBI events and performance counters.
  • Add L1-to-L1 and TLS tests to investigate TCDM deadlock.
  • Support iDMA after common-cells-v2 update.

Tasks

I have collected the tasks and reviewer comments/suggestions of PR #88:

  • Apply modifications of PR idma: Streamline TCDM connection, enable multi-channel operation #238 to the most recent version of the snitch_cluster.
  • Merge the corresponding idma branch into devel (PR #88).
  • Update custom_instructions.md.
  • Cut wide_in by default.
  • Fix failing Snitch CI tests.
  • Test iDMA after common-cells-v2 update.
  • Fix linting issues.
  • Fix Spyglass violation in common_cells.
  • Fix Spyglass violation in idma.
  • Check for (performance) regressions.
  • Check TCDM interconnect area utilization.
snitch_cluster_idma_pr_pre

Figure 1: Old integration of `idma`. The wide AXI4 XBAR interconnect is used for: (i) DMA interfaces to TCDM and SoC; (ii) NoC wide in/out; (iii) I$; (iv) Zero memory; and (v) BootROM.
snitch_cluster_idma_pr_post

Figure 2: New integration of `idma`. The wide AXI4 XBAR interconnect is simplified: (i) DMA interfaces to TCDM via OBI and wide AXI4 requests are transmitted to other clusters via the AXI4 XBAR (NoC wide out); (ii) Remove AXI4 TCDM port and directly interface the NoC wide inputs of external DMAs to the TCDM subsystem (bypassing the XBAR); (iii) Remove zero memory as the iDMA now supports memset initialization of TCDM.

gbellocchi and others added 30 commits June 2, 2026 23:12
* `axi_zero_mem` is removed because the idma can now initialize the memory to a desired value.
* Modify the wide cluster xbar address map based on the removal of the zero memory and the new idma-tcdm integration.
* Update the cluster and dma enums in the `snitch_pkg`.
The wide `soc_in_axi_req` is directly interfaced with the tcdm subsystem and bypasses the wide axi cluster xbar.
* `snitch_cluster`: Add memory and obi typedefs.
* `snitch_cluster`: Add obi-to-tcdm protocol conversion for dma requests toward the tcdm subsystem.
* `snitch_cluster`: Update interface of `snitch_cc` instance.
* `snitch_cc`: Instantiate `idma` with obi interfaces.
idma: Fix dminit opcode encoding and add TCDM tests
* Avoid the flattening of arrays in the tcdm dma interconnect.
* Fix deadlock in tcdm-to-tcdm idma transfers, which originates from the absence of p_valid for write transactions.

* Add write pipeline shift register (mirroring id_pipeline) for tracking whether an in-flight slot is a write.
* Add GUI version of `vsim` among the `run.py` simulators.

* Add `wave-file` argument to specify a corresponding wave file to automatically source when launching the `vsim-gui` simulator.

* Add support for wave argument in the generated `snitch_cluster.vsim.gui` script.
* Tie off the `obi_dma_req_o` when no DMA is instantiated in the `snitch_cc`.
* Tie off undriven signals to avoid having undefined behaviors.

* Add documentation for the obi-to-tcdm bridge.
* hw: Update hw configuration files and templates.

* hw: Remove commented lines in `snitch_cluster.sv` for address remapping after zeromem removal.

* sw: Update experiment json configuration files.
* Remove hardcoded reference to DM core as core 8.

* Update dma wait api.
* Map arrays to l1 in order to test l1-to-l1 dma transfers. To this end, use `snrt_l1_alloc()` to initialize `src` and `dst` arrays.

* Extend the range of traffic sizes to trigger the l1-to-l1 deadlock experienced with other kernels (exp).
* This test assesses proper tls initialization at runtime (sanity check) and modification at application-time (core isolation).
* This test concerns the traffic patterns used in `snrt_init_tls` at runtime.

* Parameters are currently tuned on the specific case of the `exp` kernel.
`obi_to_tcdm` was invoking the `AMONone` parameter from the `reqrsp_pkg`, while this was moved to `snitch_pkg`.
Fix SYNTH_89 warning in spyglass into the `snitch_cluster` and concerning the definition of `enabled_dma_addr_rule`.
This is solved similarly to what previously done for `enabled_dma_xbar_rule` in a previous commit.
Since PR pulp-platform#328 excludes the tracer when DEBUG is not defined, then the tests fail. So, the experiments are now built with `DEBUG=ON` so the tracer is built and performance reports are generated.
Fix Spyglass error by breaking comb-loop in `idma`.
* This was initially removed when the `idma` RW interfaces was modified, since it was breaking performance counter tests.

* Fix miscellaneous linting errors.
Cut combinational loop between OBI interface and `idma` by substituing handshake-based flow control with credit-based. This solution substitutes the previously proposed one in the `idma` backend, which was more invasive as it affected all `idma` versions. To this end, the latter was also reverted to an older version.
Waive 'W123' and 'W287a' spyglass violations, which should be handled into `idma`.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 12, 2026
Bender.yml iDMA -> __deploy__14dcdf1__devel: devel with common_cells v2
(iDMA #99) on top of the MX compute and the single-sourced compute_op
encoding, matching main's common_cells v2 base. The MX tests and compute
helpers move to the per-tile macro idiom of the reshaped heterogeneous-tile
address map (GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation
drops testmode_i (cc-v2 iDMA removed the test-mode ports); snitch_cluster is
pinned to dk/idma070 (DanielKellerM fork), which threads the obi/init type
parameters iDMA 0.7.0 added to idma_inst64_top - an interim shim converging
with pulp-platform/snitch_cluster#330, to be dropped when it merges.
* Fix spyglass violation in `cc_stream_fifo_optimal_wrap`.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 19, 2026
Bender.yml iDMA -> 0.7.0 (the release carries the merged MX quant/dequant
compute, the single-sourced compute_op encoding, and common_cells v2, matching
main's common_cells v2 base). The MX tests and compute helpers move to the
per-tile macro idiom of the reshaped heterogeneous-tile address map
(GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation drops testmode_i
(cc-v2 iDMA removed the test-mode ports); snitch_cluster is pinned to
dk/idma070 (DanielKellerM fork), which threads the obi/init type parameters
iDMA 0.7.0 added to idma_inst64_top - an interim shim converging with
pulp-platform/snitch_cluster#330, to be dropped when it merges.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 19, 2026
Bender.yml iDMA -> 0.7.0 (the release carries the merged MX quant/dequant
compute, the single-sourced compute_op encoding, and common_cells v2, matching
main's common_cells v2 base). The MX tests and compute helpers move to the
per-tile macro idiom of the reshaped heterogeneous-tile address map
(GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation drops testmode_i
(cc-v2 iDMA removed the test-mode ports); snitch_cluster is pinned to
dk/idma070 (DanielKellerM fork), which threads the obi/init type parameters
iDMA 0.7.0 added to idma_inst64_top - an interim shim converging with
pulp-platform/snitch_cluster#330, to be dropped when it merges.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 19, 2026
Bender.yml iDMA -> 0.7.0 (the release carries the merged MX quant/dequant
compute, the single-sourced compute_op encoding, and common_cells v2, matching
main's common_cells v2 base). The MX tests and compute helpers move to the
per-tile macro idiom of the reshaped heterogeneous-tile address map
(GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation drops testmode_i
(cc-v2 iDMA removed the test-mode ports); snitch_cluster is pinned to
dk/idma070 (DanielKellerM fork), which threads the obi/init type parameters
iDMA 0.7.0 added to idma_inst64_top - an interim shim converging with
pulp-platform/snitch_cluster#330, to be dropped when it merges.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 19, 2026
Bender.yml iDMA -> 0.7.0 (the release carries the merged MX quant/dequant
compute, the single-sourced compute_op encoding, and common_cells v2, matching
main's common_cells v2 base). The MX tests and compute helpers move to the
per-tile macro idiom of the reshaped heterogeneous-tile address map
(GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation drops testmode_i
(cc-v2 iDMA removed the test-mode ports); snitch_cluster is pinned to
dk/idma070 (DanielKellerM fork), which threads the obi/init type parameters
iDMA 0.7.0 added to idma_inst64_top - an interim shim converging with
pulp-platform/snitch_cluster#330, to be dropped when it merges.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 19, 2026
Bender.yml iDMA -> 0.7.0 (the release carries the merged MX quant/dequant
compute, the single-sourced compute_op encoding, and common_cells v2, matching
main's common_cells v2 base). The MX tests and compute helpers move to the
per-tile macro idiom of the reshaped heterogeneous-tile address map
(GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation drops testmode_i
(cc-v2 iDMA removed the test-mode ports); snitch_cluster is pinned to
dk/idma070 (DanielKellerM fork), which threads the obi/init type parameters
iDMA 0.7.0 added to idma_inst64_top - an interim shim converging with
pulp-platform/snitch_cluster#330, to be dropped when it merges.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 19, 2026
Bender.yml iDMA -> 0.7.0 (the release carries the merged MX quant/dequant
compute, the single-sourced compute_op encoding, and common_cells v2, matching
main's common_cells v2 base). The MX tests and compute helpers move to the
per-tile macro idiom of the reshaped heterogeneous-tile address map
(GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation drops testmode_i
(cc-v2 iDMA removed the test-mode ports); snitch_cluster is pinned to
dk/idma070 (DanielKellerM fork), which threads the obi/init type parameters
iDMA 0.7.0 added to idma_inst64_top - an interim shim converging with
pulp-platform/snitch_cluster#330, to be dropped when it merges.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 19, 2026
Bender.yml iDMA -> 0.7.0 (the release carries the merged MX quant/dequant
compute, the single-sourced compute_op encoding, and common_cells v2, matching
main's common_cells v2 base). The MX tests and compute helpers move to the
per-tile macro idiom of the reshaped heterogeneous-tile address map
(GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation drops testmode_i
(cc-v2 iDMA removed the test-mode ports); snitch_cluster is pinned to
dk/idma070 (DanielKellerM fork), which threads the obi/init type parameters
iDMA 0.7.0 added to idma_inst64_top - an interim shim converging with
pulp-platform/snitch_cluster#330, to be dropped when it merges.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 19, 2026
Bender.yml iDMA -> 0.7.0 (the release carries the merged MX quant/dequant
compute, the single-sourced compute_op encoding, and common_cells v2, matching
main's common_cells v2 base). The MX tests and compute helpers move to the
per-tile macro idiom of the reshaped heterogeneous-tile address map
(GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation drops testmode_i
(cc-v2 iDMA removed the test-mode ports); snitch_cluster is pinned to
dk/idma070 (DanielKellerM fork), which threads the obi/init type parameters
iDMA 0.7.0 added to idma_inst64_top - an interim shim converging with
pulp-platform/snitch_cluster#330, to be dropped when it merges.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 19, 2026
Bender.yml iDMA -> 0.7.0 (the release carries the merged MX quant/dequant
compute, the single-sourced compute_op encoding, and common_cells v2, matching
main's common_cells v2 base). The MX tests and compute helpers move to the
per-tile macro idiom of the reshaped heterogeneous-tile address map
(GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation drops testmode_i
(cc-v2 iDMA removed the test-mode ports); snitch_cluster is pinned to
dk/idma070 (DanielKellerM fork), which threads the obi/init type parameters
iDMA 0.7.0 added to idma_inst64_top - an interim shim converging with
pulp-platform/snitch_cluster#330, to be dropped when it merges.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 19, 2026
Bender.yml iDMA -> 0.7.0 (the release carries the merged MX quant/dequant
compute, the single-sourced compute_op encoding, and common_cells v2, matching
main's common_cells v2 base). The MX tests and compute helpers move to the
per-tile macro idiom of the reshaped heterogeneous-tile address map
(GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation drops testmode_i
(cc-v2 iDMA removed the test-mode ports); snitch_cluster is pinned to
dk/idma070 (DanielKellerM fork), which threads the obi/init type parameters
iDMA 0.7.0 added to idma_inst64_top - an interim shim converging with
pulp-platform/snitch_cluster#330, to be dropped when it merges.
DanielKellerM added a commit to pulp-platform/gwaihir that referenced this pull request Aug 19, 2026
Bender.yml iDMA -> 0.7.0 (the release carries the merged MX quant/dequant
compute, the single-sourced compute_op encoding, and common_cells v2, matching
main's common_cells v2 base). The MX tests and compute helpers move to the
per-tile macro idiom of the reshaped heterogeneous-tile address map
(GW_L2_SPM_*(i), 4 KiB DMA window); the backend instantiation drops testmode_i
(cc-v2 iDMA removed the test-mode ports); snitch_cluster is pinned to
dk/idma070 (DanielKellerM fork), which threads the obi/init type parameters
iDMA 0.7.0 added to idma_inst64_top - an interim shim converging with
pulp-platform/snitch_cluster#330, to be dropped when it merges.
@colluca
colluca changed the base branch from develop to main August 19, 2026 19:18

@colluca colluca left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to finish but a first few comments.

parameter type obi_a_chan_t = logic,
parameter type obi_r_chan_t = logic,
parameter type obi_req_t = logic,
parameter type obi_rsp_t = logic,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the reqrsp interface macros (from the reqrsp_interface repo) to internally derive the req_t and rsp_t types for the OBI and INIT interfaces from the chan_t types? Would simplify the CC parameter list.

output logic barrier_o,
input logic barrier_i,
// Address decode map
input addr_rule_t [TCDMAliasEnable:0] dma_addr_rule_i,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we name it dma_addr_map_i to reflect the dma's port name?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file can be deleted. It was probably restored by accident during the merge with the latest CC changes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file can also be deleted I believe, same as above.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete, same as above.

Comment thread make/vsim.mk
@echo '$(SN_VSIM) +permissive $(SN_VSIM_FLAGS) \
@echo 'WAVE_ARGS=()' >> $@.gui
@echo '[ -n "$$QUESTA_WAVE_DO" ] && WAVE_ARGS=(-do "do $$QUESTA_WAVE_DO")' >> $@.gui
@echo '$(SN_VSIM) +permissive "$${WAVE_ARGS[@]}" $(SN_VSIM_FLAGS) \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you used this for debugging, but I think we can remove it

Comment thread sw/runtime/src/dma.h

#define R_TYPE_ENCODE(funct7, rs2, rs1, funct3, rd, opcode) \
((funct7 << 25) | (rs2 << 20) | (rs1 << 15) | (funct3 << 12) | (rd << 7) | \
(opcode))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding all this stuff back, let's add support for DMINIT to the compiler. With the new autogenerated toolchain it should be as trivial as simply bumping riscv-opcodes.

Comment thread sw/runtime/src/dma.h
* @param size The size of the transfer in bytes.
* @param channel The index of the channel.
*/
inline uint32_t snrt_dma_memset_init_1d(uint64_t ptr, uint8_t value,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's different from snrt_dma_memset? Can't we just update that function to use DMINIT?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for deprecating, let's just delete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants